#!/usr/bin/env python3
# $Id: radiusd.py acabbce13f25 2012/11/11 02:33:52 pgurumur $
# Copyright (c) 2012 Prabhu Gurumurthy <pgurumur@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
# File radiusd.py generated on Saturday September 22, 2012 @ 08:24:46 PDT
#

__version__  = "$Revision: acabbce13f25 $"
__author__   = "$Author: pgurumur $"
__modified__ = "$Date: 2012-11-11 02:33:52Z $"

import optparse
import os
import sys

from venya3.lib import exception, cmdparser, stdlib

class radiusd(cmdparser.GetOpt):
   option_list = (
         optparse.make_option("-p", "--port", type = "int",
            help = "RADIUS authentication port to use, default: 1812",
            default = 1812, dest = "port"),
         optparse.make_option("-c", "--config", type = "str",
            help = "RADIUS configuration to use", dest = "config"),
   ) + cmdparser.GetOpt.option_list

   usage = "[ options ]"

   def __init__(self, *args, **kwargs):
      super(radiusd, self).__init__(*args, **kwargs)
      self._config = None

   @cmdparser.getopts
   def handle(self):
      if self.options.config:
         print(self.options.config)

if __name__ == "__main__":
   daemon = None
   try:
      daemon = radiusd(version = 0.1, args = sys.argv)
      daemon.handle()
   except exception.GetOptError as err:
      print(err)
      sys.exit(1)
